//
//  AddNewCommonRouteVC.m
//  NtoccShipper
//
//  Created by mac on 2019/11/29.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "AddNewCommonRouteVC.h"
#import "MapViewController.h"
#import "ZHFAddTitleAddressView.h"

@interface AddNewCommonRouteVC ()<ZHFAddTitleAddressViewDelegate>{
    FlexFrameView *header;
}
@property (weak, nonatomic) IBOutlet UIButton *btnSave;
@property(nonatomic,strong)ZHFAddTitleAddressView * addTitleAddressView;
@property(nonatomic,strong)ZHFAddTitleAddressView * addUnloadGoodsTitleAddressView;


@property (nonatomic,strong) CJTextField *fieldUploadName;
@property (nonatomic,strong) CJTextField *fieldUploadPhone;
@property (nonatomic,strong) CJTextField *fieldUpLoadAddress;
@property (nonatomic,strong) FlexTextView *fieldUpLoadAddressDetail;
@property (nonatomic,copy) NSString *strUpLoadCityCode;

@property (nonatomic,strong) CJTextField *fieldDownloadName;
@property (nonatomic,strong) CJTextField *fieldDownloadPhone;
@property (nonatomic,strong) CJTextField *fieldDownLoadAddress;
@property (nonatomic,strong) FlexTextView *fieldDownLoadAddressDetail;
@property (nonatomic, strong) CJView *zhuanghuoAddressView;
@property (nonatomic,copy) NSString *strDownLoadCityCode;

@property (nonatomic,copy) NSString *strIsUpload; // 1 发货 0 收货

@property (nonatomic,copy) NSString *strCode;

// 地图选点部分
@property (nonatomic,strong) UIImageView *imgVUpladMap;
@property (nonatomic,strong) UIImageView *imgVUpladAdress;
@property (nonatomic,strong) UIImageView *imgVDownLoadMap;
@property (nonatomic,strong) UIImageView *imgVDownLoadAddress;

//装卸货经纬度
@property (nonatomic,copy) NSString *strShipperLongitude; //经度
@property (nonatomic,copy) NSString *strShipperLatitude;
@property (nonatomic,copy) NSString *strConsigneeLongitude;
@property (nonatomic,copy) NSString *strConsigneeLatitude;


@end

@implementation AddNewCommonRouteVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self setBackLeftButton:@""];
//    if (self.isEditorRoute.intValue == 0) {
//        [self setTitleName:CJLString(@"新增常用路线")];
//
//    }else{
//        [self setTitleName:CJLString(@"修改常用路线")];
//    }
    [self setTitleName:self.strTitle];
    
    self.strShipperLatitude = @"";
    self.strShipperLongitude = @"";
    self.strConsigneeLatitude = @"";
    self.strShipperLongitude = @"";

    self.btnSave.backgroundColor = [UIColor cjMainColor];
    [self createTopView];
    

    self.addTitleAddressView = [[ZHFAddTitleAddressView alloc]init];
    self.addUnloadGoodsTitleAddressView = [[ZHFAddTitleAddressView alloc]init];
//    [self setUI];
    

//    @"consigneeName":self.fieldUploadName.text,
//    @"consigneePhone":self.fieldUploadPhone.text,
//    @"consigneeCountyCode":self.strUpLoadCityCode,
//    @"consigneeAddress":self.fieldUpLoadAddress.text,
//    @"consigneeDetailAddress":self.fieldUpLoadAddressDetail.text,
//
//    @"consignorName":self.fieldDownloadName.text,
//    @"consignorPhone":self.fieldDownloadPhone.text,
//    @"consignorCountyCode":self.strDownLoadCityCode,
//    @"consignorAddress":self.fieldDownLoadAddress.text,
//    @"consignorDetailAddress":self.fieldDownLoadAddressDetail.text,

    if (self.isEditorRoute.intValue == 0) {
        
    }else{
        //编辑地址

        if ([CJControl getSelectAdressByAmap]) {
            
        }else{
            self.addTitleAddressView.titleIDMarr = [[NSMutableArray alloc] initWithObjects:@"371302", nil];
            self.addUnloadGoodsTitleAddressView.titleIDMarr = [[NSMutableArray alloc] initWithObjects:@"371302", nil];
        }

//        [self.addressBtn setTitle:@"广东省 汕头市 潮阳区 海门镇" forState:UIControlStateNormal];
        
        self.fieldDownloadName.text  = self.commonRouteModel.consigneeName;
        self.fieldDownloadPhone.text  = self.commonRouteModel.consigneePhone;
        self.fieldDownLoadAddress.text = self.commonRouteModel.consigneeAddress;
        self.strDownLoadCityCode = self.commonRouteModel.consigneeCountyCode;
        self.fieldDownLoadAddressDetail.text = self.commonRouteModel.consigneeDetailAddress;

        self.fieldUploadName.text= self.commonRouteModel.consignorName;
        self.fieldUploadPhone.text= self.commonRouteModel.consignorPhone;
        self.strUpLoadCityCode = self.commonRouteModel.consignorCountyCode;
        self.fieldUpLoadAddress.text= self.commonRouteModel.consignorAddress;
        self.fieldUpLoadAddressDetail.text = self.commonRouteModel.consignorDetailAddress;

        self.strCode = self.commonRouteModel.code;
        self.fieldUpLoadAddressDetail.placeholder = @"";
        self.fieldDownLoadAddressDetail.placeholder = @"";
        
        // 经纬度赋值
        self.strShipperLatitude = self.commonRouteModel.shipperLatitude;
        self.strShipperLongitude = self.commonRouteModel.shipperLongitude;
        self.strConsigneeLatitude = self.commonRouteModel.consigneeLatitude;
        self.strConsigneeLongitude = self.commonRouteModel.consigneeLongitude;

    }

    if (self.isEditorSendGoodsRoute) {
        
        self.addTitleAddressView.titleIDMarr = [[NSMutableArray alloc] initWithObjects:@"371302", nil];
        self.addUnloadGoodsTitleAddressView.titleIDMarr = [[NSMutableArray alloc] initWithObjects:@"371302", nil];

        ////    [self.addressBtn setTitle:@"广东省 汕头市 潮阳区 海门镇" forState:UIControlStateNormal];
        self.fieldUploadName.text = self.dicSendGoodsRouteData[@"consignorName"];
        self.fieldUploadPhone.text = self.dicSendGoodsRouteData[@"consignorPhone"];
        self.strUpLoadCityCode = self.dicSendGoodsRouteData[@"consignorCountyCode"];
        self.fieldUpLoadAddress.text = self.dicSendGoodsRouteData[@"consignorAddress"];
        self.fieldUpLoadAddressDetail.text = self.dicSendGoodsRouteData[@"consignorDetailAddress"];

        self.fieldDownloadName.text = self.dicSendGoodsRouteData[@"consigneeName"];
        self.fieldDownloadPhone.text = self.dicSendGoodsRouteData[@"consigneePhone"];
        self.fieldDownLoadAddress.text = self.dicSendGoodsRouteData[@"consigneeAddress"];
        self.strDownLoadCityCode = self.dicSendGoodsRouteData[@"consigneeCountyCode"];
        self.fieldDownLoadAddressDetail.text = self.dicSendGoodsRouteData[@"consigneeDetailAddress"];


        // 经纬度赋值
        self.strShipperLatitude = [CJControl getThreeUnaryValueStr:self.dicSendGoodsRouteData[@"shipperLatitude"]];
        self.strShipperLongitude = [CJControl getThreeUnaryValueStr:self.dicSendGoodsRouteData[@"shipperLongitude"]];
        self.strConsigneeLatitude = [CJControl getThreeUnaryValueStr:self.dicSendGoodsRouteData[@"consigneeLatitude"]];
        self.strConsigneeLongitude = [CJControl getThreeUnaryValueStr:self.dicSendGoodsRouteData[@"consigneeLongitude"]];
        
        
    }
    

    if ([CJRegular getIsStrEmpty:self.fieldUpLoadAddressDetail.text]) {
        
        self.fieldUpLoadAddressDetail.placeholder = @"请填写详细发货地址";
    }else{
        self.fieldUpLoadAddressDetail.placeholder = @"";

    }

    if ([CJRegular getIsStrEmpty:self.fieldDownLoadAddressDetail.text]) {
        
        self.fieldDownLoadAddressDetail.placeholder = @"请填写详细收货地址";
    }else{
        self.fieldDownLoadAddressDetail.placeholder = @"";

    }
    

    if ([CJControl getSelectAdressByAmap]) {
        self.fieldUpLoadAddressDetail.placeholder = @"";
        self.fieldDownLoadAddressDetail.placeholder = @"";
    }else{
        [self setUI];
    }
    
    [self setFieldLimit];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
//    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

}
- (void)createTopView{
    //    WS(ws);
    CGRect rcFrame = CGRectMake(0, kTopHeight, kScreenWidth, 0);
    if (!header) {
        header = [[FlexFrameView alloc] initWithFlex:@"AddNewCommonRotueView" Frame:rcFrame Owner:self];
    }
    if ([self.isChangeXHAddress isEqualToString:@"1"]) {
        self.zhuanghuoAddressView.hidden = YES;
    }else{
        self.zhuanghuoAddressView.hidden = NO;
    }
    header.flexibleHeight = YES;

    if ([CJControl getSelectAdressByAmap]) {
        self.imgVUpladMap.hidden = NO;
        self.imgVUpladAdress.hidden = YES;
        self.imgVDownLoadMap.hidden = NO;
        self.imgVDownLoadAddress.hidden = YES;
//        self.fieldUpLoadAddressDetail.userInteractionEnabled = NO;
//        self.fieldDownLoadAddressDetail.userInteractionEnabled = NO;
  

    }else{
        self.imgVUpladMap.hidden = YES;
        self.imgVUpladAdress.hidden = NO;
        self.imgVDownLoadMap.hidden = YES;
        self.imgVDownLoadAddress.hidden = NO;
//        self.fieldUpLoadAddressDetail.userInteractionEnabled = YES;
//        self.fieldDownLoadAddressDetail.userInteractionEnabled = YES;
    }
    
    [header layoutIfNeeded];
    [self.view addSubview:header];
    
}



-(void)setUI{
    
    //山东省 临沂市 兰山区   打印的对应省市县的id=37 =3713 = 371302
    
    self.addTitleAddressView.title = @"选择地址";
    self.addTitleAddressView.delegate1 = self;
    self.addTitleAddressView.defaultHeight = 350;
    self.addTitleAddressView.titleScrollViewH = 37;
    if (self.addTitleAddressView.titleIDMarr.count > 0) {
        self.addTitleAddressView.isChangeAddress = true;
    }
    else{
        self.addTitleAddressView.isChangeAddress = false;
    }
//    self.addTitleAddressView.isChangeAddress  = YES;
    [self.view addSubview:[self.addTitleAddressView initAddressView]];
    
    
    //山东省 临沂市 兰山区   打印的对应省市县的id=37 =3713 = 371302
    
    self.addUnloadGoodsTitleAddressView.title = @"选择地址";
    self.addUnloadGoodsTitleAddressView.delegate1 = self;
    self.addUnloadGoodsTitleAddressView.defaultHeight = 350;
    self.addUnloadGoodsTitleAddressView.titleScrollViewH = 37;
    if (self.addUnloadGoodsTitleAddressView.titleIDMarr.count > 0) {
        self.addUnloadGoodsTitleAddressView.isChangeAddress = true;
    }
    else{
        self.addUnloadGoodsTitleAddressView.isChangeAddress = false;
    }
//    self.addTitleAddressView.isChangeAddress  = YES;
    [self.view addSubview:[self.addUnloadGoodsTitleAddressView initAddressView]];
    
}


///选择发货地
- (void)btnSelelctShipperAddressAction{

    if ([CJControl getSelectAdressByAmap]) {
        
        MapViewController *vc = [MapViewController new];
        MapInfoModel *mapInfoModel = [[MapInfoModel alloc]init];

        if ([self.strShipperLongitude isEqualToString:@""]) {
            vc.isLocatedFirst = YES;
            vc.isChange = NO;

        }else{
            vc.isLocatedFirst = NO;
            vc.isChange = YES;
            mapInfoModel.latitude =  self.strShipperLatitude;
            mapInfoModel.longitude = self.strShipperLongitude;
        }
        
        vc.mapInfoModel = mapInfoModel;
        
        WS(ws);
        vc.blockMapInfo = ^(id anyObject) {
            MapInfoModel *model = (MapInfoModel *)anyObject;
            ws.strUpLoadCityCode = model.adcode;
            ws.strShipperLatitude = model.latitude;
            ws.strShipperLongitude = model.longitude;
            ws.fieldUpLoadAddress.text = CJStringWithFormat(@"%@%@%@",model.province,model.city,model.district);
            ws.fieldUpLoadAddressDetail.placeholder = @"";
            ws.fieldUpLoadAddressDetail.text = CJStringWithFormat(@"%@%@",model.address,model.addressTitle);
            DLog(@"发货地");
        };
        [self pushVc:vc];
        
    }else{
        
        self.strIsUpload = @"1";
        [self.view endEditing:NO];
        [self.addTitleAddressView addAnimate];
    }
}

//选择卸货地
- (void)btnSelelctDownloadAddressAction{

    
    if ([CJControl getSelectAdressByAmap]) {
        
        MapViewController *vc = [MapViewController new];
        MapInfoModel *mapInfoModel = [[MapInfoModel alloc]init];
       
        
        if ([self.strConsigneeLatitude isEqualToString:@""]) {
            vc.isLocatedFirst = YES;
            vc.isChange = NO;

        }else{
            vc.isLocatedFirst = NO;
            vc.isChange = YES;
            mapInfoModel.latitude = self.strConsigneeLatitude;
            mapInfoModel.longitude = self.strConsigneeLongitude;
        }
        vc.mapInfoModel = mapInfoModel;
        WS(ws);
        vc.blockMapInfo = ^(id anyObject) {
            
            MapInfoModel *model = (MapInfoModel *)anyObject;
            ws.strDownLoadCityCode = model.adcode;
            ws.strConsigneeLatitude = model.latitude;
            ws.strConsigneeLongitude = model.longitude;
            ws.fieldDownLoadAddress.text = CJStringWithFormat(@"%@%@%@",model.province,model.city,model.district);
            ws.fieldDownLoadAddressDetail.placeholder = @"";
            ws.fieldDownLoadAddressDetail.text = CJStringWithFormat(@"%@%@",[CJControl getThreeUnaryValueStr:[CJControl getThreeUnaryValueStr:model.address]],model.addressTitle);
            
            DLog(@"卸货地");
        };
        [self pushVc:vc];
    }else{
        
        self.strIsUpload = @"0";
        [self.view endEditing:NO];
        [self.addUnloadGoodsTitleAddressView addAnimate];
    }

}
-(void)cancelBtnClick:(NSString *)titleAddress titleID:(NSString *)titleID{
//    [self.addressBtn setTitle:titleAddress forState:UIControlStateNormal];
    NSLog( @" ======%@   %@",titleAddress,  [NSString stringWithFormat:@"%@",titleID]);
   
    
    if (titleID.length == 14) {
        if ([self.strIsUpload isEqualToString:@"1"]) {
             self.fieldUpLoadAddress.text = [CJControl stringByReplacingOccurrencesOfString:titleAddress];
            if (titleID.length > 6) {
                self.strUpLoadCityCode = [titleID substringFromIndex:titleID.length - 6];

            }
        }else{
             self.fieldDownLoadAddress.text = [CJControl stringByReplacingOccurrencesOfString:titleAddress];
            if (titleID.length > 0) {
                self.strDownLoadCityCode = [titleID substringFromIndex:titleID.length - 6];

            }
        }
    }
    
//    titleAddress = [titleAddress stringByReplacingOccurrencesOfString:@"" withString:@","];
//    titleID = [titleID stringByReplacingOccurrencesOfString:@"" withString:@","];
}

- (void)setFieldLimit{
    
    self.fieldUploadName.textFieldType = CJTextFieldStringTypeNone;
    self.fieldUploadName.maxLength = CJTextLengthMax;
    
//    self.fieldUploadPhone.textFieldType = CJTextFieldStringTypeNumber;
//    self.fieldUploadPhone.maxLength = CJTextLengthPhone;
    
    self.fieldUpLoadAddress.textFieldType = CJTextFieldStringTypeNone;
    self.fieldUpLoadAddress.maxLength = CJTextLengthMax;
    
    self.fieldDownloadName.textFieldType = CJTextFieldStringTypeNone;
    self.fieldDownloadName.maxLength = CJTextLengthMax;
    
//    self.fieldDownloadPhone.textFieldType = CJTextFieldStringTypeNumber;
//    self.fieldDownloadPhone.maxLength = CJTextLengthPhone;
    
    self.fieldDownLoadAddress.textFieldType = CJTextFieldStringTypeNone;
    self.fieldDownLoadAddress.maxLength = CJTextLengthMax;
}
- (IBAction)btnSaveAction:(id)sender {

    
    if ([CJRegular getIsStrEmpty:self.fieldUploadName.text]) {
        [[[AFViewShaker alloc] initWithView:self.fieldUploadName] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"请填写发货人姓名"];
            
        }];
    }else if ([[CJControl getThreeUnaryValueStr:self.fieldUploadPhone.text] isEqualToString:@""]){
        [[[AFViewShaker alloc] initWithView:self.fieldUploadPhone] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"收货人联系电话不对"];
            
        }];
    }else if ([CJRegular getIsStrEmpty:self.fieldUpLoadAddress.text] ){
        [[[AFViewShaker alloc] initWithView:self.fieldUpLoadAddress] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"请选择收货人地址"];
            
        }];
    }else  if ([CJRegular getIsStrEmpty:self.fieldDownloadName.text]) {
        [[[AFViewShaker alloc] initWithView:self.fieldDownloadName] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"请填写收货人姓名"];
            
        }];
    }else if ([[CJControl getThreeUnaryValueStr:self.fieldDownloadPhone.text] isEqualToString:@""]){
        [[[AFViewShaker alloc] initWithView:self.fieldDownloadPhone] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"收货人联系电话不对"];
            
        }];
    }else if ([CJRegular getIsStrEmpty:self.fieldDownLoadAddress.text] ){
        [[[AFViewShaker alloc] initWithView:self.fieldDownLoadAddress] shakeWithDuration:[ShakerTime floatValue] completion:^{
            [CJAlert showStringDismissWithDelay:@"请选择收货人地址"];
            
        }];
    }else if ([CJRegular getIsStrEmpty:self.fieldUpLoadAddressDetail.text]) {
        [CJAlert showStringDismissWithDelay:@"请填写详细发货地址"];
    }else if (self.fieldUpLoadAddressDetail.text.length > 255){
        [CJAlert showStringDismissWithDelay:@"详细发货地址过长"];

    }else if ([CJRegular getIsStrEmpty:self.fieldDownLoadAddressDetail.text]) {
        
        [CJAlert showStringDismissWithDelay:@"请填写详细收货地址"];
    }else if (self.fieldDownLoadAddressDetail.text.length > 255){
        [CJAlert showStringDismissWithDelay:@"详细发收地址过长"];

    }
    
    else{
        if ([self.isChangeXHAddress isEqualToString:@"1"]) {
            [self changeAddress];
        }else{
            [self newAddress];
        }
        
        
        
        
    }
    
}
- (void)changeAddress{
    NSString *strURL = CJStringWithFormat(@"%@/ntocc-tms-api/order/updateOrderPlace",CJBaseUrl);
    NSDictionary *dicPar = @{
        @"code":self.code,
        @"consigneeSubdivisionCode":self.strDownLoadCityCode,
        @"consigneeAddress":self.fieldDownLoadAddress.text,
        @"consigneeDetailAddress":self.fieldDownLoadAddressDetail.text,
        
        @"consigneeLongitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLongitude],
        @"consigneeLatitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLatitude]
//                  consignee consignor
    };
    
    WS(ws);
    

  [[HDNetworking sharedHDNetworking] POST:strURL parameters:dicPar success:^(id  _Nonnull responseObject) {
        
        DLog(@"++++++++%@",responseObject);
        [ws pop];
    
        
    } failure:^(NSError * _Nonnull error) {
        DLog(@"++++++++%@",error);
        
    }];
}
- (void)newAddress{
    NSDictionary *dicP = @{
        @"consignorName":self.fieldUploadName.text,
        @"consignorPhone":self.fieldUploadPhone.text,
        @"consignorCountyCode":self.strUpLoadCityCode,
        @"consignorAddress":self.fieldUpLoadAddress.text,
        @"consignorDetailAddress":self.fieldUpLoadAddressDetail.text,
        @"shipperLongitude":[CJControl getThreeUnaryValueStr:self.strShipperLongitude],
        @"shipperLatitude":[CJControl getThreeUnaryValueStr:self.strShipperLatitude],
        
        @"consigneeName":self.fieldDownloadName.text,
        @"consigneePhone":self.fieldDownloadPhone.text,
        @"consigneeCountyCode":self.strDownLoadCityCode,
        @"consigneeAddress":self.fieldDownLoadAddress.text,
        @"consigneeDetailAddress":self.fieldDownLoadAddressDetail.text,
        @"consigneeLongitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLongitude],
        @"consigneeLatitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLatitude]
    };
    if (self.isSendGoods) {

        if (self.isEditorSendGoodsRoute) {
            if (self.blockChangeAddNewRoute) {
                self.blockChangeAddNewRoute(dicP);
            }
        }else{
            if (self.blockSendGoods) {
                self.blockSendGoods(dicP);
            }
        }
        
        [self pop];
        return;
    }
    if (self.isEditorRoute.intValue == 0) {
      
          DLog(@"====== %@",self.fieldUploadName.text);
          NSString *strURL = CJStringWithFormat(@"%@/ntocc-basic-api/commonRouteInfo",CJBaseUrl);
          NSDictionary *dicPar = @{
              // consignor
              @"consignorName":self.fieldUploadName.text,
              @"consignorPhone":self.fieldUploadPhone.text,
              @"consignorCountyCode":self.strUpLoadCityCode,
              @"consignorAddress":self.fieldUpLoadAddress.text,
              @"consignorDetailAddress":self.fieldUpLoadAddressDetail.text,
              @"shipperLongitude":[CJControl getThreeUnaryValueStr:self.strShipperLongitude],
              @"shipperLatitude":[CJControl getThreeUnaryValueStr:self.strShipperLatitude],
              
              @"consigneeName":self.fieldDownloadName.text,
              @"consigneePhone":self.fieldDownloadPhone.text,
              @"consigneeCountyCode":self.strDownLoadCityCode,
              @"consigneeAddress":self.fieldDownLoadAddress.text,
              @"consigneeDetailAddress":self.fieldDownLoadAddressDetail.text,
              @"consigneeLongitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLongitude],
              @"consigneeLatitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLatitude]
//                  consignee consignor
          };
          
          WS(ws);
          

        [[HDNetworking sharedHDNetworking] POST:strURL parameters:dicPar success:^(id  _Nonnull responseObject) {
              
              DLog(@"++++++++%@",responseObject);
              [ws pop];
          
              
          } failure:^(NSError * _Nonnull error) {
              DLog(@"++++++++%@",error);
              
          }];
        
    }else{
        
          DLog(@"====== %@",self.fieldUploadName.text);
          NSString *strURL = CJStringWithFormat(@"%@/ntocc-basic-api/commonRouteInfo",CJBaseUrl);
          NSDictionary *dicPar = @{
              @"consignorName":self.fieldUploadName.text,
              @"consignorPhone":self.fieldUploadPhone.text,
              @"consignorCountyCode":self.strUpLoadCityCode,
              @"consignorAddress":self.fieldUpLoadAddress.text,
              @"consignorDetailAddress":self.fieldUpLoadAddressDetail.text,
              @"shipperLongitude":[CJControl getThreeUnaryValueStr:self.strShipperLongitude],
              @"shipperLatitude":[CJControl getThreeUnaryValueStr:self.strShipperLatitude],
              
              @"consigneeName":self.fieldDownloadName.text,
              @"consigneePhone":self.fieldDownloadPhone.text,
              @"consigneeCountyCode":self.strDownLoadCityCode,
              @"consigneeAddress":self.fieldDownLoadAddress.text,
              @"consigneeDetailAddress":self.fieldDownLoadAddressDetail.text,
              @"consigneeLongitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLongitude],
              @"consigneeLatitude":[CJControl getThreeUnaryValueStr:self.strConsigneeLatitude],
              @"code":self.strCode
              
          };
         // consignee consignor
        WS(ws);
        [[HDNetworking sharedHDNetworking] PUT:strURL parameters:dicPar success:^(id  _Nonnull responseObject) {
              
              DLog(@"++++++++%@",responseObject);
              [ws pop];
          
              
          } failure:^(NSError * _Nonnull error) {
              DLog(@"++++++++%@",error);
              
          }];
    }
    
}


@end
